Crafty.c("Player",{
  _value: 0,
   init: function() {
      this.requires("Collision").onHit("wall",function(obj) {
        this.cancelSlide();
      });
      this.requires("Collision").onHit("Item",function(obj) {
        var item = obj[0].obj;
        var val = item.getItemValue();
        this.addTotalValue(val);
        item.destroy();
      });
    },

	addTotalValue: function(val) {
	this._value += val;
},

	clearTotalValue: function() {
	this._value = 0;
},

	getTotalValue: function() {
	return this._value;
} 
});	